﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;

namespace GiaoDien
{
    public partial class WebForm11 : System.Web.UI.Page
    {
        ServiceKD.ServiceSoapClient proxy = new GiaoDien.ServiceKD.ServiceSoapClient("ServiceSoap");
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnUpHinh_Command(object sender, CommandEventArgs e)
        {

        }

        protected void btnThem_Click(object sender, EventArgs e)
        {

            ServiceKD.SanPhamMoi temp = new GiaoDien.ServiceKD.SanPhamMoi();
            temp.tenSanPham = txtTenSP.Text;
            temp.soLuongCungCap = Int32.Parse(txtSoLuongCungCap.Text);
            temp.giaBan = Double.Parse(txtGiaBan.Text);
            temp.giaBanToiDa = Double.Parse(txtGiaBanToiDa.Text);
            temp.maNhaCungCap = Int32.Parse("1");
            temp.moTa = txtMoTa.Text;
            temp.hinhAnh = txtTenHinh.Text;
            bool kq = proxy.gioiThieuSanPhamMoi(temp);
            if (kq)
                lblThongBao.Text = "Thêm thành công";
            else
                lblThongBao.Text = "Thêm thất bại";
        }

    }
}
